const express = require('express')

const app = express()
app.use(require('cors')()) // 设置允许跨域

app.get('/cuifan', (req, res) => {
  const user = {
    uname: 'cuifan',
    age: 20,
    sayHi() {
      console.log('Hi~');

    }
  }
  res.send(JSON.stringify(user))
})

app.get('/simon', (req, res) => {
  console.log(req.url);

})

app.listen(3000, function() {
  console.log('server is running...');
})